import 'package:boss/common/common.dart';
import 'package:flutter/material.dart';

class LoaderError extends StatelessWidget {
  final String errorText;
  final VoidCallback onTap;
  const LoaderError({
    this.errorText,
    this.onTap,
    Key key,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      alignment: Alignment.center,
      child: Column(
        mainAxisSize: MainAxisSize.min,
        children: <Widget>[
          Text(errorText ?? Constant.httpErrText),
          IconButton(icon: const Icon(Icons.refresh), onPressed: onTap),
        ],
      ),
    );
  }
}
